<#include "/includes/vars.inc">  
<@pp.dropOutputFile />
<#assign fileName = "${webDir}/login.xhtml">
<#if config.login?? && !pp.outputFileExists(fileName)>
	<@pp.changeOutputFile name="${fileName}" />
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
<#if includeLoginJsf>
    <ui:composition template="/template.xhtml">
        <ui:define name="body">
            <h:form id="formLogin">
                <p:panel
                    id="panelLogin"
                    header="${r"#{"}msg.login}"
                    styleClass="login"
                    rendered="${r"#{"}!loginController.loggedIn}">
                    <p:messages/>
                    <h:panelGrid columns="2">
                        <h:outputLabel for="loginName"
                                       style="font-size:0.9em;"
                                       value="${r"#{"}msg.loginName}:" />
                        <h:inputText id="loginName"
                                     style="width:200px;"
                                     value="${r"#{"}credentialsController.login}"/>
                        <h:outputLabel for="password"
                                       style="font-size:0.9em;"
                                       value="${r"#{"}msg.password}:" />
                        <h:inputSecret id="password"
                                       style="width:200px;"
                                       value="${r"#{"}credentialsController.password}"/>
                        <h:outputText value="" />
                        <p:commandButton value="${r"#{"}msg.login}"
                                         update=":formLogin,:formMenu,:formMenuTop"
                                         actionListener="${r"#{"}loginController.login}" />
                    </h:panelGrid>
                </p:panel>
                <h:outputText value="${r"#{"}msg.appName} v${r"#{"}msg.appVersion} &copy; 2012"
                              styleClass="info-app"
                              rendered="${r"#{"}!loginController.loggedIn}"
                              />
            </h:form>
        </ui:define>
    </ui:composition>
 <#else>
 <ui:composition template="/template.xhtml">
        <ui:define name="body">
            <h:form id="formLogin">
                <p:panel
                    id="panelLogin"
                    header="${r"#{"}msg.login}"
                    styleClass="login"
                    rendered="${r"#{"}!loginController.loggedIn}">
                    <p:messages/>
                    <h:panelGrid columns="2">
                        <h:outputLabel for="loginName"
                                       style="font-size:0.9em;"
                                       value="${r"#{"}msg.loginName}:" />
                        <h:inputText id="loginName"
                                     style="width:200px;"
                                     value="${r"#{"}loginController.login}"/>
                        <h:outputLabel for="password"
                                       style="font-size:0.9em;"
                                       value="${r"#{"}msg.password}:" />
                        <h:inputSecret id="password"
                                       style="width:200px;"
                                       value="${r"#{"}loginController.password}"/>
                        <h:outputText value="" />
                        <p:commandButton value="${r"#{"}msg.login}"
                                         update=":formLogin,:formMenu,:formMenuTop"
                                         actionListener="${r"#{"}loginController.login}" />
                    </h:panelGrid>
                </p:panel>
                <h:outputText value="${r"#{"}msg.appName} v${r"#{"}msg.appVersion} &copy; 2012"
                              styleClass="info-app"
                              rendered="${r"#{"}!loginController.loggedIn}"
                              />
            </h:form>
        </ui:define>
    </ui:composition>
 </#if>

</html>
</#if>
